<?php
/**
 * Set the timezone.
 */
date_default_timezone_set('Europe/London');

/**
 * Set the path so we can find the classes.
 */
set_include_path('.' . PATH_SEPARATOR . './config' . PATH_SEPARATOR . './classes' . PATH_SEPARATOR . './models' . PATH_SEPARATOR . './pages' . PATH_SEPARATOR . './myclasses' . PATH_SEPARATOR . get_include_path());

/**
 * Load the framework and initialise it.
 */
require_once('Framework.php');
Framework::init();

/*Framework::registerSession(new Session_Namespace('MyApp'));
$session = new Session_Namespace('Test');
Framework::registerSession($session);*/

Framework::setConfig(new Config_Ini('./config/config.ini'));

/**
 * A test try block. Load a config and run a simple query.
 */
try {
    /*Framework::setRouter(new Router_Xml('./config/routes.xml'));
    
    $select = new Database_Select();
    $select->from(array('u' => 'users'), array('useradddate' => new Database_Expr("DATE_FORMAT(userAddDate, '%Y')")))->where('userAddDate IS NOT ?', new Database_Expr('NULL'))->orderBy('userName')->limit(10);
    echo "<p>" . $select . "</p>";
    $rows = $select->query();
    Debug::dump($rows->getRow(3));
    Debug::dump($rows, true);*/
    
    $table = new CustomerCollection();
    foreach($table as $t) {
        Debug::display($t);
    }
    $table->selectAll();
    foreach($table as $t) {
        //Debug::display($t);
    }
    Debug::display($table);
    
    //Framework::getDispatcher()->setViewRenderer(new View_Renderer_Custom());

	Framework::getDispatcher()->dispatch();
} catch(Exception $e) {
	Debug::showException($e);
}
?>
